package cn.edu.dao;

import cn.edu.domain.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Davey chan
 */
@Mapper
public interface Col_TeacherDao {
    //    已审核分页查询
/*
    List<All> selectBypage(@Param("begin") int begin, @Param("size")int size);*/
    //    查询总记录数
    @Select("select count(*) from teacher where Examstatus='3'")
    int selectTotalCount();

    //    已审核分页查询

    List<All> selectBypageAndCondtion(@Param("begin") int begin, @Param("size")int size, @Param("t")All t);
    //    查询总记录数

    int selectTotalCountByCondition(All t);

    @Select("select * from thesis where teacherID=#{id}")
    List<thesis> getThesis(Integer id);
    @Select(" select * from research_project where teacherID=#{id}")
    List<research_project> getResearch_project(Integer id);
    @Select(" select * from annual_examination where teacherID=#{id}")
    List<annual_examination> getAnnual_examination(Integer id);
    @Select("select * from award where teacherID=#{id}")
    List<award> getAward(Integer id);
    @Select("select * from honor_title where teacherID=#{id}")
    List<honor_title> getHonor_title(Integer id);
    @Select("  select * from opus where teacherID=#{id}")
    List<opus> getOpus(Integer id);
    @Select("select * from teach_work where teacherID=#{id}")
    List<teach_work> getTeach_work(Integer id);
    @Select("select * from train where teacherID=#{id}")
    List<train> getTrain(Integer id);
    @Select("select * from patent where teacherID=#{id}")
    List<patent> getPatent(Integer id);
    @Select("select * from `work` where teacherID=#{id}")
    List<work> getWork(Integer id);
//    删除教师,不直接删除，改成审核状态直接为0
    @Delete("update teacher set Examstatus='0' where teacherID=#{id}")
    void delteacher(Integer id);

    void UpdateTeacher(All t);
}
